const { MARK_FLAGS } = require('./share.js')

class ManagerTempBlob{
    constructor() {
        this.tempBlobs = new Map()
        this.markFlags = 0
    }
    addTempBlob(data, markType) {
        this.markFlags |= MARK_FLAGS[markType] // 按位或操作叠加标记
        this.tempBlobs.set(markType, data)
    }

    checkComb(requiredFlags) {
        return (this.markFlags & requiredFlags) === requiredFlags
    }

    clear() {
        this.tempBlobs.clear()
        this.markFlags = 0
    }
}

module.exports = {ManagerTempBlob}